package com.killer.view;

import java.util.HashMap;
import java.util.Map;

/**
 * 监控数据容器
 */
public class MonitorContext {

    /**
     * 用于保存对应方法和对应的监控数据
     */
    private static Map<String, MonitorData> monitorDataMap=new HashMap<String, MonitorData>();

    public static Map<String,MonitorData> getMonitorDataMap(){
        return monitorDataMap;
    }

    public static MonitorData getMethodMonitorData(String methodName) {
        MonitorData monitorData = monitorDataMap.get(methodName);
        return monitorData==null?new MonitorData(methodName,0):monitorData;
    }

    public static void setMethodMonitorData(String methodName,MonitorData monitorData) {
        monitorDataMap.put(methodName, monitorData);
    }

}
